package com.learn.ert.controller;

import com.alibaba.fastjson.JSONObject;
import com.learn.ert.base.BaseApiService;
import com.learn.ert.base.BaseResponse;
import com.learn.ert.pojo.ErRoleEntity;
import com.learn.ert.service.ErRoleService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;



/**
 * 
 *
 * @author sjf
 * @email 2334593702@qq.com
 * @date 2020-08-14 17:47:02
 */
@RestController
@RequestMapping("api/errole")
@Api(tags = "角色信息接口")
public class ErRoleController extends BaseApiService<JSONObject> {
    @Autowired
    private ErRoleService erRoleService;
/*

    */
/**
     * 列表
     *//*

    @RequestMapping("/list")
  //  @RequiresPermissions("api:errole:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = erRoleMapper.queryPage(params);

        return R.ok().put("page", page);
    }


    */
/**
     * 信息
     */

    @RequestMapping("/allRole")
    public BaseResponse<JSONObject>  info(){

        HashMap<Object, Object> empHashMap = new HashMap<Object, Object>();
		List<ErRoleEntity> list = erRoleService.list();
		System.out.println(list);
        empHashMap.put("list",list);

        return setResultSuccess((JSONObject) JSONObject.toJSON(empHashMap));
    }



/**
     * 保存
     *//*

    @RequestMapping("/save")
   // @RequiresPermissions("api:errole:save")
    public R save(@RequestBody ErRoleEntity erRole){
		erRoleMapper.insert(erRole);

        return R.ok();
    }

    */
/**
     * 修改
     *//*

    @RequestMapping("/update")
    //@RequiresPermissions("api:errole:update")
    public R update(@RequestBody ErRoleEntity erRole){
		erRoleMapper.updateById(erRole);

        return R.ok();
    }

    */
/**
     * 删除
     *//*

//    @RequestMapping("/delete")
//    //@RequiresPermissions("api:errole:delete")
//    public R delete(@RequestBody Integer[] rIds){
//		erRoleMapper.removeByIds(Arrays.asList(rIds));
//
//        return R.ok();
//    }
*/

}
